<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="Document">
  <meta name="Description" content="Document">
  <title>Document</title>
  <!-- <script type="text/javascript" src="jquery-1.7.1.min.js"></script> -->
  <style type="text/css">
	.header-menu2 {
    margin: 55px 0;
}
  </style>
  <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
   <script type="text/javascript">
$(document).ready(function() {

//header-menu
//header-menu
   $(".header-menu").find("select").first().attr("id", "responsive-nav");
   $(".header-menu").find("select").first().attr("onchange", "javascript:location.href=this.value;");
   //$("<option " +  " value='0'>菜单</option>").appendTo($(".header-menu").find("select").first());
   //$(".header-menu").find("select").first().prepend("<option " +  " value='0'>菜单</option>");

    $(".header-menu").find("select option[value]").each(function() {
      var jQthis = $(this);

		if(jQthis.val() ==0){
		$("select option[value='0']").css("display","none");
        }
		$(".header-menu").find("select").appendTo().first();
    });


//header-menu2
//header-menu2

   $(".header-menu2").find("select").first().attr("id", "responsive-nav2");
   $(".header-menu2").find("select").first().attr("onchange", "javascript:location.href=this.value;");
   //$("<option " +  " value='0'>菜单</option>").appendTo($(".header-menu").find("select").first());
   //$(".header-menu").find("select").first().prepend("<option " +  " value='0'>菜单</option>");

    $(".header-menu2").find("select option[value]").each(function() {
      var jQthis = $(this);

		if(jQthis.val() ==0){
		$("select option[value='0']").css("display","none");
        }
		$(".header-menu2").find("select").appendTo().first();
    });

});

$(".footer span").each(function() {
    $(this).prepend("<br>Powered by <a href='https://127.0.0.1'  target='_blank' rel='nofollow'>XXXXXXX网站</a><br>")
});
 </script>
 </head>
 <body>
 
<div class="header-menu"><h2>预设一个0默认值，下拉选择首页可以跳转到指定链接</h2>
<select>
<option value="0">菜单</option>
<option value="http://127.0.0.1/">首页</option>
<option value="http://127.0.0.1/category.html">栏目1</option>
<option value="http://127.0.0.1/category2.html">栏目2</option>
</select>
</div>

<div class="header-menu2"><h2>直接取默认值，下拉选择首页不能跳转到指定链接</h2>
<select>
<option value="http://127.0.0.1/">首页</option>
<option value="http://127.0.0.1/category.html">栏目1</option>
<option value="http://127.0.0.1/category2.html">栏目2</option>
</select>

</div>
<footer class="footer wrapper">
<p class="copyright">Copyright XXXXXXXXXX Rights Reserved.
<span></span>
</p>
</footer>


 </body>


</html>
